/*
 * @brief:
 * @Author: TzzzT
 * @Date: 2022-09-24 13:46:12
 * @LastEditTime: 2023-03-24 02:08:51
 * @LastEditors: TzzzT
 */
#pragma once

#include "RCS_master.h"

typedef struct net_rx_pbuf_s
{
  char *message_buf;
  uint16_t message_size;
} net_rx_pbuf_t;

#define NET_RX_FIFO_DEPTH 10
typedef struct net_rx_fifo_s
{
  net_rx_pbuf_t *fifo[NET_RX_FIFO_DEPTH];
  uint8_t get_index;
  uint8_t put_index;
  bool is_full;
} net_rx_fifo_t;

enum net_contrl_opt_e
{
  LED_OPEN = 0,
  LED_CLOSE,
  LED_TICKLE_FREQ_1,
  LED_TICKLE_FREQ_2,
  LED_TICKLE_CLOSE,
  MOTOR_OPEN,
  MOTOR_CLOSE,
  MUSIC_SN,
  SCREEN_DATA,
};

void net_init(void);
char *make_net_json_package(send_to_server_data_type_t type, size_t *message_len, void *param[]);
void net_send(char *package, size_t raw_len);
